﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
/// <summary>
/// Summary description for OTOBUSSINESS
/// </summary>
public class OTO_BUSSINESS
{
    public DataSet ListXe(OTO_ENTITY ot)
    {
        string ACTION = "LIST";
        return OTO_DATAACCESS.GETDATATABLE(ACTION,ot);
    }
    public Hashtable HashListXe(OTO_ENTITY ot)
    {
        string ACTION = "LIST";
        Hashtable ht = new Hashtable();
        DataSet ds = OTO_DATAACCESS.GETDATATABLE(ACTION, ot);
        if (ds.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                ht.Add(dr["MAXE"], dr["TENXE"]);
            }
        }
        return ht;
    }
    public Hashtable HashListXeHinh(OTO_ENTITY ot)
    {
        string ACTION = "LIST";
        Hashtable ht = new Hashtable();
        DataSet ds = OTO_DATAACCESS.GETDATATABLE(ACTION, ot);
        if (ds.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                ht.Add(dr["MAXE"], dr["TENXE"] + "-" + dr["HINH"]);
            }
        }
        return ht;
    }
    public DataSet ListXeTheoMaHang(OTO_ENTITY ot)
    {
        string ACTION = "LIST_BYMAHANG";
        return OTO_DATAACCESS.GETDATATABLE(ACTION, ot);
    }
    public DataSet HashListXeTheoMaHang(OTO_ENTITY ot)
    {
        string ACTION = "LIST_BYMAHANG";
        Hashtable ht = new Hashtable();
        DataSet ds = OTO_DATAACCESS.GETDATATABLE(ACTION, ot);
        return ds;
        //if (ds.Tables[0].Rows.Count > 0)
        //{
        //    foreach (DataRow dr in ds.Tables[0].Rows)
        //    {
        //        ht.Add(dr["MAXE"], dr["TENXE"]);
        //    }
        //}
        //return ht;
    }
    public DataSet ListXeTrangChu()
    {
        string ACTION = "LIST_TRANGCHU";
        DataSet ds = OTO_DATAACCESS.GETDATATABLENONE(ACTION);
        return ds;
        //if (ds.Tables[0].Rows.Count > 0)
        //{
        //    foreach (DataRow dr in ds.Tables[0].Rows)
        //    {
        //        ht.Add(dr["MAXE"], dr["TENXE"]);
        //    }
        //}
        //return ht;
    }
    public DataSet Web_ChiTietXe(OTO_ENTITY ote)
    {
        string ACTION = "WEB_CHITIETXE";
        DataSet ds = OTO_DATAACCESS.GETDATATABLESER(ACTION, ote);
        return ds;       
    }
    public DataSet Web_SearchXe(OTO_ENTITY ote)
    {
        string ACTION = "WEB_SEARCHXE";
        DataSet ds = OTO_DATAACCESS.GETDATATABLESER(ACTION, ote);
        return ds;
    }
    public DataSet Web_PhanTram(OTO_ENTITY ote)
    {
        string ACTION = "WEB_PHANTRAM";
        DataSet ds = OTO_DATAACCESS.GETDATAPT(ACTION, ote);
        return ds;
    }

    public void Web_UPDATEPT(OTO_ENTITY ote)
    {
        string ACTION = "WEB_UPDATEPHANTRAM";
        OTO_DATAACCESS.UpdateDATAPT(ACTION, ote);
    }
}